package com.jeesite.modules.kj.api.controller.member;


import com.jeesite.common.collect.ListUtils;
import com.jeesite.modules.kj.api.vo.response.SkillResponseVo;
import com.jeesite.modules.kj.api.vo.responseVo.ResponseBean;
import com.jeesite.modules.kj.entity.KjSkill;
import com.jeesite.modules.kj.service.KjMemberService;
import com.jeesite.modules.kj.service.KjSkillService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * Author:hzy
 * Date:2021/07/04
 * Description:特长
 */
@Api(value = "特长api", tags = {"特长API"})
@Slf4j
@Controller
@RequestMapping(value = "/api/skill")
public class SkillApiController {
    private final static Logger logger = LoggerFactory.getLogger(SkillApiController.class);
    @Autowired
    private KjMemberService kjMemberService;

    @Autowired
    private KjSkillService kjSkillService;

    @ApiOperation(value = "获取专长列表", notes = "获取专长列表")
    @GetMapping(value = "list")
    public ResponseBean<List<SkillResponseVo>> list() {
        List<KjSkill> skillList = kjSkillService.findList(new KjSkill());
        List<SkillResponseVo> vos = ListUtils.newArrayList();
        for (KjSkill skill: skillList
             ) {
            vos.add(new SkillResponseVo(skill));
        }
        return new ResponseBean<>(vos);
    }


}
